﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Hangjing.Model;
using Hangjing.SQLServerDAL;

using System.Text;
using System.Text.RegularExpressions;
using Hangjing.SQLServerDAL.serverinterface;
using Hangjing.Weixin;

/// <summary>
/// 获取小程序用户信息（openid）
/// </summary>
public partial class AndroidAPI_shop_getappletinfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Clear();

        string appid = CacheHelper.GetSetValue(18);
        string code = WebUtility.InputText(Request["code"]);

        string jssessionurl = WXRequestUrlHelper.Getjscode2session(appid, code);

        HttpHelper objhttp = new HttpHelper();
        objhttp.isToLower = false;
        HttpItem objHttpItem = new HttpItem()
        {
            URL = jssessionurl,
            Encoding = "utf-8",
            Method = "get"
        };

        string returnmsg = objhttp.GetHtml(objHttpItem);

        Hangjing.AppLog.AppLog.Info("获取小程序openid=" + returnmsg);

        Response.Write(returnmsg);
        Response.End();
    }
}
